package org.wlldTest.svd;

import org.dromara.easyai.matrixTools.Matrix;
import org.dromara.easyai.matrixTools.MatrixOperation;
import org.dromara.easyai.matrixTools.SVDBody;

public class Svd {


    public static void main(String[] args) throws Exception {
        test();
    }

    public static void test() throws Exception {//月，日 时
        MatrixOperation matrixOperation = new MatrixOperation();
        Matrix matrix = new Matrix(4, 3, "[3,3,1]#[2,3,4]#[1,1,2]#[5,5,3]#");
        SVDBody svdBody = matrixOperation.svd(matrix, 300, 3);
        Matrix a = matrixOperation.mulMatrix(matrixOperation.mulMatrix(svdBody.getMatrixU(), svdBody.getFeature()), svdBody.getMatrixVT());
        System.out.println(a.getString());

    }
}
